package com.ease.platform.authorization.management;

import java.util.List;
import java.util.Map;

import com.ease.actionscript.Remoting;
import com.ease.model.criterion.QueryCriteria;
import com.ease.platform.auditlog.annotation.Auditable;
import com.ease.platform.authorization.callback.AuthorizationCallback;
import com.ease.platform.authorization.service.AuthorizationService;
import com.ease.platform.authorization.vo.AuthorizationResult;

@Remoting(false)
public interface AbstractAuthorizationManagementService extends AuthorizationService {

	@Remoting(false)
	AuthorizationResult authorize(AuthorizationCallback authorizationCallback);

	Map<String, AuthorizationResult> authorize(List<String> operationCodes);

	@Remoting(false)
	AuthorizationResult authorize(String operationCode);

	@Remoting(false)
	AuthorizationResult authorize(String operationCode, AuthorizationCallback authorizationCallback);

	/**
	 * 如果 entityTypeId == 0,那么查询metaEntityType
	 */
	@Remoting(false)
	QueryCriteria appendLocationParameter(Class<?> entityClass, long entityTypeId, QueryCriteria queryCriteria);

	@Auditable(false)
	List<Long> findMainMenuIdsByUserId(long userId);

	@Auditable(false)
	List<Long> findMainMenuIdsByGroupId(long groupId);

	@Auditable(false)
	List<Long> findExploreIdsByUserId(long userId);

	@Auditable(false)
	List<Long> findExploreIdsByGroupId(long groupId);

	@Auditable(false)
	List<Long> findPerspectViewIdsByUserId(long userId);

	@Auditable(false)
	List<Long> findPerspectViewIdsByGroupId(long groupId);

	@Auditable(false)
	List<Long> findCoolButtonByUserIdAndEntityTypeId(long userId, long entityTypeId);

	@Auditable(false)
	List<Long> findCoolButtonByGroupId(long groupId);

	@Auditable(false)
	List<Long> findRigthClickMenuByUserIdAndEntityTypeId(long userId, long entityTypeId);

	@Auditable(false)
	List<Long> findRigthClickMenuByGroupId(long groupId);

	@Auditable(false)
	List<Long> findEntityTypeIdByUserId(long userId);
	// /**
	// * 组装成Map<ENTITYTYPE_ID, List<ACTION_ID>> 找到EntityTypeId和ActionId的对应关系
	// * 如修改/删除等 许多entityTypeId对应同一种action 这个主要针对于entityTypeId
	// 上的右键菜单和toolbar上的按钮
	// *
	// */
	// @Auditable(false)
	// Map<Long, List<Long>> findRightMenuAndButtonActionsByUserId(long userId,
	// );
	//
	// @Auditable(false)
	// Map<Long, List<Long>> findRightMenuAndButtonActionsByGroupId(long userId,
	// );
}
